package vip.xiaozhao.paotui.intf.enums;


public enum PaotuiStatusEnum {

    Invalid(0, "不展示"),
    WaitPao(1, "等待接单中"),//只有该状态显示在任务列表中
    JieDan(2, "已被抢"),
    Confirmed(3, "进行中"),//查看取货信息后，不可退
    Ended(4, "结束"),
    Reviewed(5, "已评价"),
    RenGong(6, "转人工");//查看取货信息后，不可退

    private int id;
    private String name;


    PaotuiStatusEnum(int id, String name) {
        this.id = id;
        this.name = name;
    }

    public static PaotuiStatusEnum getById(int id) {
        for (PaotuiStatusEnum type : PaotuiStatusEnum.values()) {
            if (type.getId() == id)
                return type;
        }
        return null;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    /**
     * Getter method for property <tt>name</tt>.
     *
     * @return property value of name
     */
    public String getName() {
        return name;
    }

    /**
     * Setter method for property <tt>name</tt>.
     *
     * @param name value to be assigned to property name
     */
    public void setName(String name) {
        this.name = name;
    }

    public static void main(String[] args) {
        System.out.println(getById(1).getName());
    }

}
